﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using RaSuperGrid.SuperGrid.Model;

namespace RaSuperGrid.SuperGrid.ViewModel
{
    class PRCollectionViewModel
    {
        public ObservableCollection<PRItemViewModel> PRs { get; private set; }

        public PRCollectionViewModel()
        {
            var prItemViewModel = from pr in PR.GetPRs()
                                  select new PRItemViewModel(pr);

            PRs = new ObservableCollection<PRItemViewModel>(prItemViewModel);
        }

        public void AddNew()
        {
            var prItemViewModel = new PRItemViewModel(PR.NewPR());
            PRs.Add(prItemViewModel);
        }
    }
}
